﻿using sdkrtv2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Json;

namespace XiaoweiVoiceAI.Model
{
    public class FmStorySendMore : ISendMore
    {
        public int SendMoreResourceCmd(string skillId, string skillName, string playId, bool isUp, ClassDeviceSDK sdk, VOICE_ID_CS voice_id)
        {
            JsonObject skill = new JsonObject();
            skill.SetNamedValue("id", JsonValue.CreateStringValue(skillId));
            skill.SetNamedValue("name", JsonValue.CreateStringValue(skillName));
            JsonObject jo = new JsonObject();
            jo.SetNamedValue("skill_info", skill);
            jo.SetNamedValue("play_id", JsonValue.CreateStringValue(playId));
            jo.SetNamedValue("is_up", JsonValue.CreateBooleanValue(isUp));

           // Log.WriteLine($"GetMoreResources, json:{jo}");


            return sdk._xiaowei_request_cmd(voice_id, cmd: "PLAY_RESOURCE", sub_cmd: "get_more", param: jo.ToString());
        }
        private static FmStorySendMore _instance = null;
        public static FmStorySendMore GetInstance()
        {
            if (_instance == null)
            {
                _instance = new FmStorySendMore();
            }
            return _instance;
        }

        
    }
}
